package com.aji.controller;

import com.aji.entity.Origin;
import com.aji.result.Result;
import com.aji.service.OriginService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/origin")
@Api(tags = "样品来源数据管理")
@Slf4j
@CrossOrigin
public class OriginController {

    @Autowired
    private OriginService originService;

    @ApiOperation("获取 所有样品来源")
    @GetMapping
    public Result selectType(){
        List<Origin> originList = originService.selectOrigin();
        return Result.success(originList);
    }
}
